#include<pthread.h>
#include<stdlib.h>
#include<time.h>
#include<unistd.h>
#include<string>
#include<vector>
#include<iostream>
#include"ThreadPool.hpp"
#include"TASK.hpp"

int main()
{
    srand(time(NULL)^getpid());

    Threadpool<Task<int>>* tp=new Threadpool<Task<int>>(10);
    tp->start();
    while(1)
    {
        int data1=rand()%10;
        int data2=rand()%10;
        char op=opers[rand()%opers.size()];

        Task<int> t(data1,data2,op);
        tp->push(t);
        std::cout<<"i am main pthread,";
        t.getTask();
        sleep(1);
    }

    return 0;
}